<exclude-pattern>*/includes/gallery/PackedOverlayImageGallery\.php</exclude-pattern>
<exclude-pattern>*/includes/HistoryBlob\.php</exclude-pattern>
<exclude-pattern>*/includes/htmlform/HTMLFormElement\.php</exclude-pattern>
- <exclude-pattern>*/includes/jobqueue/aggregator/JobQueueAggregator\.php</exclude-pattern>
<exclude-pattern>*/includes/libs/filebackend/FileBackendStore\.php</exclude-pattern>
<exclude-pattern>*/includes/libs/filebackend/FSFileBackend\.php</exclude-pattern>
<exclude-pattern>*/includes/libs/filebackend/SwiftFileBackend\.php</exclude-pattern>
* Argon2 password hashing is now available, can be enabled via
$wgPasswordDefault = 'argon2'. It's designed to resist timing attacks
(requires PHP 7.2+) and GPU hacking (7.3+).
+* Special:CreateAccount now warns the user if their chosen username has to be
+ normalized.
=== External library changes in 1.33 ===
AuthManagerAuthPlugin, and AuthManagerAuthPluginUser.
* The $wgAuth configuration setting and its use in Setup.php and unit tests
* (T217772) The 'wgAvailableSkins' mw.config key in JavaScript, was removed.
+* Language::markNoConversion, deprecated in 1.32, has been removed. Use
+ LanguageConverter::markNoConversion instead.
=== Deprecations in 1.33 ===
* The configuration option $wgUseESI has been deprecated, and is expected
'Job' => __DIR__ . '/includes/jobqueue/Job.php',
'JobQueue' => __DIR__ . '/includes/jobqueue/JobQueue.php',
'JobQueueAggregator' => __DIR__ . '/includes/jobqueue/aggregator/JobQueueAggregator.php',
- 'JobQueueAggregatorNull' => __DIR__ . '/includes/jobqueue/aggregator/JobQueueAggregator.php',
+ 'JobQueueAggregatorNull' => __DIR__ . '/includes/jobqueue/aggregator/JobQueueAggregatorNull.php',
'JobQueueAggregatorRedis' => __DIR__ . '/includes/jobqueue/aggregator/JobQueueAggregatorRedis.php',
'JobQueueConnectionError' => __DIR__ . '/includes/jobqueue/exception/JobQueueConnectionError.php',
'JobQueueDB' => __DIR__ . '/includes/jobqueue/JobQueueDB.php',
return $pendingDBs;
}
}
-
-/**
- * @ingroup JobQueue
- */
-class JobQueueAggregatorNull extends JobQueueAggregator {
- protected function doNotifyQueueEmpty( $wiki, $type ) {
- return true;
- }
-
- protected function doNotifyQueueNonEmpty( $wiki, $type ) {
- return true;
- }
-
- protected function doGetAllReadyWikiQueues() {
- return [];
- }
-
- protected function doPurge() {
- return true;
- }
-}
--- /dev/null
+<?php
+/**
+ * Job queue aggregator code.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ */
+
+/**
+ * @ingroup JobQueue
+ */
+class JobQueueAggregatorNull extends JobQueueAggregator {
+ protected function doNotifyQueueEmpty( $wiki, $type ) {
+ return true;
+ }
+
+ protected function doNotifyQueueNonEmpty( $wiki, $type ) {
+ return true;
+ }
+
+ protected function doGetAllReadyWikiQueues() {
+ return [];
+ }
+
+ protected function doPurge() {
+ return true;
+ }
+}
$this->mConverter->updateConversionTable( $title );
}
- /**
- * Prepare external link text for conversion. When the text is
- * a URL, it shouldn't be converted, and it'll be wrapped in
- * the "raw" tag (-{R| }-) to prevent conversion.
- *
- * This function is called "markNoConversion" for historical
- * reasons *BUT DIFFERS SIGNIFICANTLY* from
- * LanguageConverter::markNoConversion(), with which it is easily
- * confused.
- *
- * @param string $text Text to be used for external link
- * @param bool $noParse Wrap it without confirming it's a real URL first
- * @return string The tagged text
- * @deprecated since 1.32, use LanguageConverter::markNoConversion()
- * instead.
- */
- public function markNoConversion( $text, $noParse = false ) {
- wfDeprecated( __METHOD__, '1.32' );
- // Excluding protocal-relative URLs may avoid many false positives.
- if ( $noParse || preg_match( '/^(?:' . wfUrlProtocolsWithoutProtRel() . ')/', $text ) ) {
- return $this->mConverter->markNoConversion( $text );
- } else {
- return $text;
- }
- }
-
/**
* A regular expression to match legal word-trailing characters
* which should be merged onto a link of the form [[foo]]bar.
"badretype": "The passwords you entered do not match.",
"usernameinprogress": "An account creation for this user name is already in progress.\nPlease wait.",
"userexists": "Username entered already in use.\nPlease choose a different name.",
+ "createacct-normalization": "Your username will be adjusted to \"$2\" due to technical restrictions.",
"loginerror": "Login error",
"createacct-error": "Account creation error",
"createaccounterror": "Could not create account: $1",
"badretype": "Used as error message when the new password and its retype do not match.",
"usernameinprogress": "Used as error message in creating a user account.",
"userexists": "Used as error message in creating a user account.",
+ "createacct-normalization": "Used as warning message on account creation when user name is adjusted silently due to technical restrictions (e.g. first letter capitalized, underscores converted to spaces).\nParameters:\n* $1 - the old username\n* $2 - the new username",
"loginerror": "Used as title of error message.\n{{Identical|Login error}}",
"createacct-error": "Used as heading for the error message.",
"createaccounterror": "Parameters:\n* $1 - an error message",
'createacct-emailrequired',
'noname',
'userexists',
+ 'createacct-normalization',
],
'dependencies' => [
'mediawiki.api',
if ( value === '' ) {
this.currentValue = value;
- this.setErrors( [] );
+ this.setErrors( true, [] );
return;
}
that.currentValue = value;
- if ( info.valid ) {
- that.setErrors( [], forceReplacement );
- } else {
- that.setErrors( info.messages, forceReplacement );
- }
+ that.setErrors( info.valid, info.messages, forceReplacement );
} ).fail( function () {
that.currentValue = null;
- that.setErrors( [] );
+ that.setErrors( true, [] );
} );
return currentRequestInternal;
/**
* Display errors associated with the form element
+ * @param {boolean} valid Whether the input is still valid regardless of the messages
* @param {Array} errors Error messages. Each error message will be appended to a
* `<span>` or `<li>`, as with jQuery.append().
* @param {boolean} [forceReplacement] Set true to force a visual replacement even
* @return {mw.htmlform.Checker}
* @chainable
*/
- mw.htmlform.Checker.prototype.setErrors = function ( errors, forceReplacement ) {
+ mw.htmlform.Checker.prototype.setErrors = function ( valid, errors, forceReplacement ) {
var $oldErrorBox, tagName, showFunc, text, replace,
$errorBox = this.$errorBox;
// FIXME: Use CSS transition
// eslint-disable-next-line no-jquery/no-slide
$errorBox
- .attr( 'class', 'error' )
+ .attr( 'class', valid ? 'warning' : 'error' )
.empty()
.append( errors.map( function ( e ) {
return errors.length === 1 ? e : $( '<li>' ).append( e );
} ) )
.slideDown();
};
- if ( $oldErrorBox !== $errorBox && $oldErrorBox.hasClass( 'error' ) ) {
+ if (
+ $oldErrorBox !== $errorBox &&
+ ( $oldErrorBox.hasClass( 'error' ) || $oldErrorBox.hasClass( 'warning' ) )
+ ) {
// eslint-disable-next-line no-jquery/no-slide
$oldErrorBox.slideUp( showFunc );
} else {
updateForCheckbox();
} );
- // Check if the username is invalid or already taken
+ // Check if the username is invalid or already taken; show username normalisation warning
mw.hook( 'htmlform.enhance' ).add( function ( $root ) {
var $usernameInput = $root.find( '#wpName2' ),
$passwordInput = $root.find( '#wpPassword2' ),
// We could just use .then() if we didn't have to pass on .abort()…
var d, apiPromise;
+ // Leading/trailing/multiple whitespace characters are always stripped in usernames,
+ // this should not require a warning. We do warn about underscores.
+ username = username.replace( / +/g, ' ' ).trim();
+
d = $.Deferred();
apiPromise = api.get( {
action: 'query',
return m.html;
} ) : []
} );
+ } else if ( userinfo.name !== username ) {
+ d.resolve( { valid: true, messages: [
+ mw.message( 'createacct-normalization', username, userinfo.name ).parseDom()
+ ] } );
} else {
d.resolve( { valid: true, messages: [] } );
}